<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件
namespace app\Admin\controller;
use think\Db;
/**
 * 通过分类id获取用户名
 */
function getVideoById($id)
{
	//读取数据库
	$videoInfo = Db::table('video') -> where('id','=',$id) ->find();
	//返回名称
	return $videoInfo;
}
	/*通过token获取头像
	*/
	function getIconUrl($uid)
	{
		// $userId = Db('users')->where('token',$token)->value('id');
		$iid = Db('userinfo') ->where('uid',$uid)->value('iid');
		$userInfo = Db('icon')->where('id',$iid)->value('url');
		return $userInfo;
	}
	/*通过token获取nickname
	*/
	function getNickname($uid)
	{
		// $userId = Db('users')->where('token',$token)->value('id');
		$nickname = Db('userinfo') ->where('uid',$uid)->value('nickname');
		return $nickname;
	}
